package com.SouthernWall_404.AgeDust.Common.Command;

import com.SouthernWall_404.AgeDust.Common.API.Util.CharacterSceenAPI;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.world.entity.player.Player;

public class CharacterEditCommand {

    public static void register(CommandDispatcher<CommandSourceStack> commandDispatcher) {
        commandDispatcher.register(Commands.literal("age_dust")
                .then(Commands.literal("character")
                .then(Commands.literal("edit").executes(CharacterEditCommand::handler))));

    }

    private static int handler(CommandContext<CommandSourceStack> context) throws CommandSyntaxException
    {
        Player player=context.getSource().getPlayer();

        if(player.level().isClientSide)
        {

        }
        else
        {
            CharacterSceenAPI.openCharacterScreen(player);
            //写一个网络通信包
        }

        return 0;
    }
}
